﻿/**
 * 
 */
package com.zit.presentation.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.dispatcher.RequestMap;

import com.zit.entity.Bedroom;
import com.zit.entity.Dorm;
import com.zit.service.DormService;

/**
 * @author 王冲
 * 功能：宿舍管理
 * date2013-12-3 time下午04:49:58
 */
public class DormAction extends BaseAction {
	private int id;
	
	/**
	 * 功能：查询公寓
	 * @return
	 */
	public String selectDorm(){
		System.out.println("成功");
		List<Dorm> listDorm = new ArrayList<Dorm>();
		DormService dormService = new DormService();
		
		listDorm = dormService.selectDorm();
		requestMap.put("listDorm", listDorm);
		
		return "dormsuccess";
	}
	
	/**
	 * 功能：添加公寓
	 * @return
	 */
	public String addDorm(){
		System.out.println("成功");
		List<Dorm> listDorm = new ArrayList<Dorm>();
		DormService dormService = new DormService();
		
		
		return SUCCESS;
	}
	
	/**
	 * 功能：查询公寓对应的宿舍
	 * @return
	 */
	public String selectBedroom(){
		List<Bedroom> listBed = new ArrayList<Bedroom>();
		DormService dormService = new DormService();
		listBed = dormService.selectBedroom(id);
		requestMap.put("listBed", listBed);
		
		return "bedsuccess";
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
}

